import request from '@/utils/request'

// 分页查询位置
export function findBaseSpaceLocationPageList(data) {
    return request({
      url: '/spaceLocation/findBaseSpaceLocationPageList',
      method: 'post',
      data
    })
}

// 新增or修改位置
export function addOrUpdateBaseSpaceLocationInfo(data) {
  return request({
    url: '/spaceLocation/addOrUpdateBaseSpaceLocationInfo',
    method: 'post',
    data
  })
}

// 新增or修改位置
export function deleteBaseSpaceLocationInfo(data) {
  return request({
    url: '/spaceLocation/deleteBaseSpaceLocationInfo',
    method: 'post',
    data
  })
}

export function getLocationDetails(id) {
  return request({
    url: '/spaceLocation/details/'+id,
    method: 'get'
  })
}
//宿舍床位
export function getDormitoryBerthList(id) {
  return request({
    url: '/spaceLocation/getDormitoryBerthList/'+id,
    method: 'get'
  })
}

//修改床位使用
export function updateDedUse(data) {
  return request({
    url: '/spaceLocation/updateDed',
    method: 'post',
    data
  })
}
//新增或修改楼栋信息
export function buildingAddOrUpdate(data) {
  return request({
    url: '/spaceLocation/buildingAddOrUpdate',
    method: 'post',
    data
  })
}
//查询楼层信息
export function buildingSelect(data) {
  return request({
    url: '/spaceLocation/buildingSelect',
    method: 'post',
    data
  })
}
//删除楼层
export function buildingDelete(data) {
  return request({
    url: '/spaceLocation/buildingDelete',
    method: 'post',
    data
  })
}
//查询楼层
export function selectDormitory() {
  return request({
    url: '/spaceLocation/selectDormitory',
    method: 'get',
  })
}
